package com.ruoyi.manage.mapper;

import java.util.List;
import com.ruoyi.manage.domain.CrInterviewAppointment;
import org.apache.ibatis.annotations.Param;

/**
 * 面试预约Mapper接口
 */
public interface CrInterviewAppointmentMapper
{
    /**
     * 查询面试预约
     */
    public CrInterviewAppointment selectCrInterviewAppointmentByAppointmentId(Long appointmentId);

    /**
     * 查询面试预约列表
     */
    public List<CrInterviewAppointment> selectCrInterviewAppointmentList(CrInterviewAppointment crInterviewAppointment);

    /**
     * 查询学生的面试预约列表
     */
    public List<CrInterviewAppointment> selectStudentInterviewAppointmentList(@Param("userId") Long userId);

    /**
     * 查询社团的面试预约列表
     */
    public List<CrInterviewAppointment> selectClubInterviewAppointmentList(@Param("clubId") Long clubId, @Param("status") String status);

    /**
     * 根据申请ID查询面试预约
     */
    public CrInterviewAppointment selectInterviewAppointmentByApplicationId(Long applicationId);

    /**
     * 根据时间段ID查询预约列表
     */
    public List<CrInterviewAppointment> selectAppointmentsBySlotId(Long slotId);

    /**
     * 检查学生是否已预约该时间段
     */
    public CrInterviewAppointment selectAppointmentByUserAndSlot(@Param("userId") Long userId, @Param("slotId") Long slotId);

    /**
     * 查询今日面试预约
     */
    public List<CrInterviewAppointment> selectTodayInterviewAppointments(@Param("clubId") Long clubId);

    /**
     * 查询即将到来的面试（提醒功能）
     */
    public List<CrInterviewAppointment> selectUpcomingInterviews(@Param("hours") int hours);

    /**
     * 统计面试预约数量
     */
    public int countAppointmentsByClub(@Param("clubId") Long clubId);

    /**
     * 统计各状态预约数量
     */
    public List<CrInterviewAppointment> countAppointmentsByStatus(@Param("clubId") Long clubId);

    /**
     * 新增面试预约
     */
    public int insertCrInterviewAppointment(CrInterviewAppointment crInterviewAppointment);

    /**
     * 修改面试预约
     */
    public int updateCrInterviewAppointment(CrInterviewAppointment crInterviewAppointment);

    /**
     * 删除面试预约
     */
    public int deleteCrInterviewAppointmentByAppointmentId(Long appointmentId);

    /**
     * 批量删除面试预约
     */
    public int deleteCrInterviewAppointmentByAppointmentIds(Long[] appointmentIds);

    /**
     * 批量更新预约状态
     */
    public int batchUpdateAppointmentStatus(@Param("appointmentIds") Long[] appointmentIds, @Param("status") String status);

    /**
     * 取消预约（学生操作）
     */
    public int cancelAppointment(@Param("appointmentId") Long appointmentId, @Param("userId") Long userId);
}